package cn.rkylin.oms.warehouseDocking.adapter;

import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import cn.rkylin.oms.common.dto.DBLog;
import cn.rkylin.oms.common.utils.LogUtil;
import cn.rkylin.oms.warehouse.returnStockin.vo.ReturnStockinVO;
import cn.rkylin.oms.warehouse.shiporder.vo.ShiporderVO;

/**
 * 淘宝奇门仓库适配器
 * 
 * @author jipengcheng
 * @created 2017年10月16日
 */
@Component("qimenAdapter")
public class QimenAdapter extends WarehouseDockingAdapter {

	@Autowired
	private LogUtil logUtil;

	private static final Log logger = LogFactory.getLog(QimenAdapter.class);

	/**
	 * 同步商品接口 taobao.qimen.singleitem.synchronize
	 */
	@Override
	public int synchronizeGoods(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().synchronizeGoods(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 其他出库单创建接口 taobao.qimen.stockout.create
	 */
	@Override
	public int otherStockoutCreate(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().otherStockoutCreate(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 取消退货入库单 taobao.qimen.order.cancel
	 */
	@Override
	public int cancelReturnStockin(ReturnStockinVO returnStockInVO) throws Exception {
		return getWarehouseDockingVisitor().cancelReturnStockin(returnStockInVO);
	}

	/**
	 * 手动取消出库单 taobao.qimen.order.cancel
	 */
	@Override
	public int manualCancelShiporder(ShiporderVO shiporderVO) throws Exception {
		return getWarehouseDockingVisitor().manualCancelShiporder(shiporderVO);
	}

	/**
	 * 自动取消出库单 taobao.qimen.order.cancel
	 */
	@Override
	public int autoCancelShiporder(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().autoCancelShiporder(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 发货单创建接口 taobao.qimen.deliveryorder.create
	 */
	@Override
	public int shipOrderCreate(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().shipOrderCreate(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 获取仓库库存(多商品)接口 taobao.qimen.inventory.query
	 */
	@Override
	public int getInventory(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().getInventory(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 退货入库单创建接口 taobao.qimen.returnorder.create
	 */
	@Override
	public int returnOrderCreate(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().returnOrderCreate(shopId, paramMap);
		return iRtn;
	}

	/**
	 * 入库单创建接口 taobao.qimen.entryorder.create
	 */
	@Override
	public int entryOrderCreate(String shopId, Map<String, Object> paramMap) throws Exception {
		int iRtn = getWarehouseDockingVisitor().entryOrderCreate(shopId, paramMap);
		return iRtn;
	}

}
